package com.example.testbroadcast;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.widget.Toast;

public class DynamicReceiver extends BroadcastReceiver {
    public static final String BROADCAST_ACTION_DISC = "com.test.LocatiopnBroadcast";
    public static final String BROADCAST_ACTION_LOCAL = "com.test.LocatiopnBroadcast.Local";

    @Override
    public void onReceive(Context context, Intent intent) {
        String strAction = intent.getAction();
        switch (strAction){
            case BROADCAST_ACTION_DISC:
                Toast.makeText(context, "检测到意图。DynamicReceiver", Toast.LENGTH_LONG).show();
                break;
            case BROADCAST_ACTION_LOCAL:
                Toast.makeText(context, "检测到意图。DynamicReceiver.Local", Toast.LENGTH_LONG).show();
                break;
        }
    }
}
